/**
 * @file
 * @author jinguangguo
 * @date 2017/8/11
 */

import ajax from '../../../grsc-base/util/ajax';

export default {

    /**
     * 获取用户收益信息
     * @param param
     * @param header
     * @returns {*}
     */
    getFinanceInfo(param = {}, header = {}) {
        /*
         * req
         *  fundAssetCode: 'SMCF1'
         *
         * res
         *  code: '100200',
         *  data: {
         *      //账号(邮箱)
                private String userAccount;
                //币种
                private String fundAssetCode;
                //币种数量
                private BigDecimal fundAssetCodeAmount;
                //基金净值
                private BigDecimal worth;
                //基金总净值
                private BigDecimal totalWorth;
                //基金当前市场价,单位USDT
                private BigDecimal perUnit;
                //用户认证信息
                private AuthLevel level;
                //入场券是否购买
                private boolean buyTicket;
                //基金开始日
                private Long fundBeginDate;
                //基金赎回日
                private Long fundEndDate;
                // 基金入场券开闭状态
                private String ticketStatus;
         *
         *  }
         */
        return ajax.get('/exchangeApi/quantfund/info-query', {
            data: param,
            header: header
        });
    },

    /**
     * 基本配置
     * @param param
     * @param header
     * @returns {*}
     */
    fundConfigQuery(param = {}, header = {}) {
        /*
         * req
         *  fundAssetCode: 'SMCF1'
         *
         * res
         *  code: '100200',
         *  data: {
         *      ticketStatus: 'ON'  // 'ON'/OFF
         *      beginDate: 23456789,
         *      endDate: 34567890
         *  }
         */
        return ajax.get('/exchangeApi/quantfund/query', {
            data: param,
            header: header
        });
    },

    /**
     * 判断某个交易对是否开放
     * @param param
     * @returns {*}
     */
    isSymbolTradeOpen(param = {}){
        return ajax.get('/exchangeApi/match/symbol',{
            data:param
        });
    },



    /**
     * 到期换回
     */
    ticketReturn(param = {}, header = {}){
        return ajax.get('/exchangeApi/quantfund/ticket-return', {
            data: param,
            header: header
        });
    },
    /**
     * 购买入场券
     */
     buyTicket(param = {}, header = {}){
        return ajax.get('/exchangeApi/quantfund/ticket-buy', {
            data: param,
            header: header
        });
    },


    /**
     * 提前换回
     * */
    preReturn(param = {}){
        return ajax.get('/exchangeApi/quantfund/ticket-prereturn',{
            data:param
        })
    },

    /**
     * 外部接口，趋势图、净值
     * */
    getSMCF1History(param = {}){
        return ajax.get('/smart_api/smcf1/',{
            data:param
        })
    }


};